#!/bin/bash

fruit=$1

# if test "$fruit" = apple; then
#     echo $fruit is red
# elif test "$fruit" = banana; then
#     echo $fruit is yellow
# elif test "$fruit" = pear; then
#     echo $fruit is yellow too
# elif test "$fruit" = orange; then
#     echo $fruit is orange
# elif test "$fruit" = grape; then
#     echo $fruit is purple
# else
#     echo ${fruit}\'s color is undefined
# fi

case "$fruit" in
    [aA]pple)
        echo $fruit is red
        echo I like apple
        ;;
    banana|pear|orange)
        echo $fruit is yellow ;;
    grape)
        echo $fruit is purple;;
    *g*)
        echo g in name of $fruit;;
    ???)
        echo three characters in $fruit\'s name;;
    *)
        echo $fruit\'s color is undefined;;
esac
